package com.itheima.exerciseTest.test20_29;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

public class Test22 {
    public static void main(String[] args) {
        String start = "2000-10-12 00:00:00";
        String now = "2021-03-24 00:00:00";
        String end = "2080-10-13 00:00:00";

        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime st = LocalDateTime.parse(start, dtf);
        LocalDateTime no = LocalDateTime.parse(now, dtf);
        LocalDateTime en = LocalDateTime.parse(end, dtf);

        long between1 = ChronoUnit.SECONDS.between(st, no);
        System.out.println(between1);

        long between2 = ChronoUnit.SECONDS.between(no, en);
        System.out.println(between2);



    }
}
